package com.xiaochong.tir.trades.rabbit;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * Created by org on 2018/6/16.
 * zb队列配置
 */
@Configuration
@Component
public class ZbQueenConfig {
    @Bean
    public DirectExchange ZbNodeAPIExchange() {
        return new DirectExchange(ExchangeQueue.Exchange.EX_NODE_API_MQ, true, false);
    }
    @Bean
    public Queue queueTradesZbBtcAction(){
        return new Queue(ZbMqQueue.QUEUE_TRADES_ZB_BTC, true);
    }
    @Bean
    public Binding bindingTradesZbBtcAction(){
        return BindingBuilder.bind(queueTradesZbBtcAction()).to(ZbNodeAPIExchange()).with(ZbMqQueue.QUEUE_TRADES_ZB_BTC);
    }

    @Bean
    public Queue queueTradesZbQcAction(){
        return new Queue(ZbMqQueue.QUEUE_TRADES_ZB_QC, true);
    }
    @Bean
    public Binding bindingTradesZbQcAction(){
        return BindingBuilder.bind(queueTradesZbQcAction()).to(ZbNodeAPIExchange()).with(ZbMqQueue.QUEUE_TRADES_ZB_QC);
    }
    @Bean
    public Queue queueTradesZbUsdtAction(){
        return new Queue(ZbMqQueue.QUEUE_TRADES_ZB_USDT, true);
    }
    @Bean
    public Binding bindingTradesZbUsdtAction(){
        return BindingBuilder.bind(queueTradesZbUsdtAction()).to(ZbNodeAPIExchange()).with(ZbMqQueue.QUEUE_TRADES_ZB_USDT);
    }

    @Bean
    public Queue queueTradesZbZbAction(){
        return new Queue(ZbMqQueue.QUEUE_TRADES_ZB_ZB, true);
    }
    @Bean
    public Binding bindingTradesZbZbAction(){
        return BindingBuilder.bind(queueTradesZbZbAction()).to(ZbNodeAPIExchange()).with(ZbMqQueue.QUEUE_TRADES_ZB_ZB);
    }

}
